

const 开启终端 = (command, paramsObj) => {
    const { exec } = require('child_process');
    // 将参数对象转换为 JSON 字符串
    const jsonString = JSON.stringify(paramsObj);
    // 将 JSON 字符串进行 Base64 编码
    const base64String = Buffer.from(jsonString).toString('base64');

    const child = exec(`${command} "${base64String}"`, {
        detached: true,
        stdio: 'inherit'
    });


    child.on('exit', (code) => {
    });

    child.on('error', (err) => {
        console.error(`子进程出错: ${err.message}`);
    });
};



module.exports = 开启终端